<template>
    <PageTabelLayout>
        <template #pageHeader>
            <div class="my-header" v-if="headerShow">
                <div class="search-form" style="padding: 10px;box-sizing: border-box;">
                    <a-form size="small" :model="searchData" auto-label-width layout="inline">
                        
                           
                                <a-form-item label="开单日期" label-col-flex="80px" :style="{width:'320px'}">
                                    <a-range-picker  popup-container="html"  allow-clear  @change="rangePicckerChange" class="bacClass"/>
                                </a-form-item>
                            
                           
                                <a-form-item label="布号" label-col-flex="80px" :style="{width:'320px'}">
                                    <a-input allow-clear  v-model="searchData.clothCode" class="bacClass" />
                                </a-form-item>
                            
                           
                                <a-form-item label="品名" label-col-flex="80px" :style="{width:'320px'}">
                                    <a-input allow-clear  v-model="searchData.brandName" class="bacClass" />
                                </a-form-item>
                            
                           
                                <a-form-item label="流转卡号" label-col-flex="80px" :style="{width:'320px'}">
                                    <a-input  v-model="searchData.circulatCard" allow-clear class="bacClass" />
                                </a-form-item>
                            
                        
                        
                           
                                <a-form-item label="计划单号" label-col-flex="80px" :style="{width:'320px'}">
                                    <a-input  allow-clear v-model="searchData.planCode" class="bacClass" />
                                </a-form-item>
                            
                           
                                <a-form-item label="客户名称" label-col-flex="80px" :style="{width:'320px'}">
                                    <a-input  allow-clear v-model="searchData.customName" class="bacClass" />
                                </a-form-item>
                            
                            <!-- <a-col :xxl="6" :xl="12" :lg="12" :md="12" :xs="24">
                                <a-form-item label="测试结果">
                                    <a-input-number :min="0" allow-clear v-model="searchData.verifyResult" class="aInput" />
                                </a-form-item>
                            </a-col> -->
                        
                    </a-form>
                </div>
            </div>
            <div class="my-divisders">
                <a-divider orientation="center">
                    <icon-double-up v-if="headerShow" @click="changHeadShow(false)" :strokeWidth="2" :size="18" />
                    <icon-double-down v-else @click="changHeadShow(true)" :strokeWidth="2" :size="18" />
                </a-divider>
            </div>
            <div class="my-tool-bar" style="padding:0px 10px 10px 0px;box-sizing: border-box;">
                <Toolbar :items="['查询', '新增', '审核', '删除', '导出', '打印']" @add="addHandler" @select="selectHandler"
                    @export="exportHandler" @audit="auditHandler" @dyBoufei="dyBoufeiHandler" v-if="auditState === 1"
                    @del="dels" />
                <Toolbar :items="['查询', '导出', '打印']" @add="addHandler" @select="selectHandler" @export="exportHandler"
                    @dyBoufei="dyBoufeiHandler" v-if="auditState === 2" />
            </div>
        </template>
        <template #pageTabel>
            <div style="height: 100%; overflow-y: scroll;">
                <a-tabs   :lazy-load="true" :default-active-key="1" trigger="click" @change="changHandler" justify>
                    <a-tab-pane :key="1" title="未审核">
                        <div style="height:90%">
                            <PhyManageUnApproved @has-audit="hasAudit" :searchData="searchData"
                                @edit-click="toHasRowDataEdit" @print-click="printDataClick" />
                        </div>
                    </a-tab-pane>
                    <a-tab-pane :key="2" title="已审核">
                        <div style="height:90%">
                            <phyManageApproved ref="phyManageApproved" @has-audit="hasAudit" @edit-click="toHasRowDataEdit"
                                :searchData="searchData" @print-click="printDataClick" />
                        </div>
                    </a-tab-pane>
                </a-tabs>
                <a-tabs   :lazy-load="true" :default-active-key="1" trigger="click" @change="secondChangeHandler" justify>
                    <a-tab-pane :key="1" title="物测结果">
                        <div style="height:100%">
                            <phyMeasurResult :searchData="searchData" />
                        </div>
                    </a-tab-pane>
                    <a-tab-pane :key="2" title="物测图表">
                        <div style="height:90%">
                            <phyMeasurChart :searchData="searchData" />
                        </div>
                    </a-tab-pane>
                </a-tabs>
            </div>
        </template>
    </PageTabelLayout>

    <PhyLabelPrint :is-show-print="pageData.showPrint" :labelData="pageData.phyData"
        @toClosePrint="pageData.showPrint = false" />

    <a-drawer :drawer-style="{ zIndex: 9999 }" height="100%" unmountOnClose :visible="pageData.showAdd"
        :mask-closable="false" placement="bottom" @cancel="pageData.showAdd = false">
        <template #title>
            <a-row style="width:calc(100vw - 100px);justify-content: space-between;box-sizing: border-box;">
                <a-col flex="100px"> {{ pageData.sideTitle }}</a-col>
                <a-col flex="480px">
                    <a-button type="primary" @click="pushMessHandler(1)">消息推送</a-button>
                    <a-button type="primary" @click="pushMessHandler(0)" style="margin:0 30px">撤销信息推送</a-button>
                    <a-button type="primary" @click="importHandler">导入缩水测试原始资料记录表</a-button>
                </a-col>
            </a-row>
        </template>
        <a-form ref="formRef" style="margin-top:20px" layout="horizontal" auto-label-width :model="dataForm" size="mini">
            <a-row :span="4" justify="space-between">
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="部门" field="department"
                        :rules="[{ required: true, message: '部门必填' }]" :validate-trigger="['change', 'blur']">
                        <!-- <a-select popup-container="html"  style="width: 270px;"  v-model="dataForm.department" allow-clear allow-search @search="searchHandler($event,2)" @focus="selectChange(2)">
                            <a-option v-for="item in pageData.departList" :key="item.id" :value="item.department ">{{ item.department }}</a-option>
                        </a-select>  -->
                        <!-- <a-cascader v-model="dataForm.department" :options="pageData.departList" allow-clear
                            ref="casObDepart" @change="cascaderChangeDepart" allow-search
                            :class="{ 'bacClass': !(dataForm.department == null || dataForm.department == '') }"
                            :title="pageData.departTitle" @focus="selectChange(2)" @search="searchHandler($event, 2)"
                            style="width:200px"  /> -->
                        <a-input class="bacClass" v-model="dataForm.department" style="width:200px" disabled />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="日期" field="verifyManageDate"
                        :rules="[{ required: true, message: '日期必填' }]" :validate-trigger="['change', 'blur']">
                        <a-date-picker  popup-container="html"  class="bacClass" style="width: 200px;" show-time
                            v-model="dataForm.verifyManageDate" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="记录单号" field="verifyManageCode"
                        :rules="[{ required: true, message: '记录单号必填' }]" :validate-trigger="['change', 'blur']">
                        <a-input class="bacClass" v-model="dataForm.verifyManageCode" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="流转卡号" field="circulatCard"
                        :rules="[{ required: true, message: '流转卡号必填' }]" :validate-trigger="['change', 'blur']">
                        <!-- <a-select popup-container="html"  style="width: 270px;" v-model="dataForm.circulatCard" allow-clear allow-search
                            @search="searchHandler($event, 4)" @focus="selectChange(4)" ref="circulRef"
                            @change="changeCircul">
                            <a-option v-for="item in pageData.circulDropList" :key="item.id" :value="item.flowCardCode">{{
                                item.flowCardCode }}</a-option> </a-select>-->
                        <a-input style="width:200px" v-model="dataForm.circulatCard" allow-clear class="bacClass"
                            @press-enter="huiche" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="推送部门">
                        <!-- <a-select popup-container="html"   style="width: 270px;"  v-model="pageData.pushDepartment" allow-clear allow-search @search="searchHandler($event,2)" @focus="selectChange(2)">
                        <a-option v-for="item in pageData.departList" :key="item.id" :value="item.department ">{{ item.department }}</a-option>
                    </a-select>  -->
                        <a-cascader style="width:200px" class="bacClass" v-model="pageData.pushDepartment"
                            :options="pageData.departList" allow-clear ref="casObPushDepart"
                            @change="cascaderChangePushDepart" allow-search
                            :class="{ 'bacClass': !(pageData.pushDepartment == null || pageData.pushDepartment == '') }"
                            :title="pageData.pushDepartTitle" @focus="selectChange(2)" @search="searchHandler($event, 2)" 
                            popup-container="html"/>
                    </a-form-item>
                </a-col>
            </a-row>
            <a-row :span="4" justify="space-between">
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="客户名称">
                        <a-input class="bacClass" v-model="dataForm.customName" style="width:200px" disabled />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="色号">
                        <a-input class="bacClass" v-model="dataForm.colorCode" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="色称">
                        <a-input class="bacClass" v-model="dataForm.colorName" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="布号">
                        <a-input class="bacClass" v-model="dataForm.clothCode" @change="changCode" @input="changCode"
                            style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="推送人员" field="pusher">
                        <a-select popup-container="html"  class="bacClass" style="width:200px" v-model="pageData.pusher" allow-clear allow-search
                            @search="searchHandler($event, 3)" @focus="selectChange(3)">
                            <a-option v-for="item in pageData.employeeList" :key="item.id" :value="item.name">
                                {{ item.name }}</a-option>
                        </a-select>
                    </a-form-item>
                </a-col>
            </a-row>
            <a-row :span="4" justify="space-between">
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="品名">
                        <a-input class="bacClass" v-model="dataForm.brandName" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="重量">
                        <a-input-number :min="0" class="bacClass" v-model="dataForm.weight" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="匹数">
                        <a-input class="bacClass" v-model="dataForm.pieceNum" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="纱支">
                        <a-input class="bacClass" v-model="dataForm.yarnCount" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="推送测试类型">
                        <a-select popup-container="html"  class="bacClass" style="width:200px" v-model="pageData.pushVerifyType" allow-clear
                            allow-search @search="searchHandler($event, 1)" @focus="selectChange(1)">
                            <a-option v-for="item in pageData.testTypeList" :key="item.id" :value="item.verifyType">{{
                                item.verifyType }}</a-option>
                        </a-select>
                    </a-form-item>
                </a-col>
            </a-row>
            <a-row :span="4" justify="space-between">
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="顶破强力">
                        <a-input-number :min="0" class="bacClass" v-model="dataForm.burstStrength" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="测试结果" field="verifyResult"
                        :rules="[{ required: true, message: '测试结果必填' }]" :validate-trigger="['change', 'blur']">
                        <a-select popup-container="html"  class="bacClass" style="width:200px" v-model="dataForm.verifyResult">
                            <a-option :value="0">合格</a-option>
                            <a-option :value="1">不合格</a-option>
                            <a-option :value="2">REJ让步</a-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="要求门幅">
                        <a-input-number :min="0" class="bacClass" v-model="dataForm.requireWidth" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="要求克重">
                        <a-input-number :min="0" class="bacClass" v-model="dataForm.requireWeight" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="计划单号">
                        <!-- <a-select popup-container="html"  style="width: 270px;" v-model="dataForm.planCode" allow-clear allow-search
                            @search="searchHandler($event, 5)" @focus="selectChange(5)">
                            <a-option v-for="item in pageData.planCodeList" :key="item.id" :value="item">{{ item
                            }}</a-option>
                        </a-select> -->
                        <a-input class="bacClass" v-model="dataForm.planCode" style="width:200px" />
                    </a-form-item>
                </a-col>
            </a-row>
            <a-row :span="4" justify="space-between">
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="资料员">
                        <a-input class="bacClass" v-model="dataForm.documenter" style="width:200px" disabled />
                        <!-- <a-select popup-container="html"  class="bacClass" style="width:200px" v-model="dataForm.documenter" allow-clear allow-search
                            @search="searchHandler($event, 3)" @focus="selectChange(3)">
                            <a-option v-for="item in pageData.employeeList" :key="item.id" :value="item.name">{{
                                item.name }}</a-option>
                        </a-select> -->
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="客户单号">
                        <a-input class="bacClass" v-model="dataForm.customOrderNo" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="有效门幅">
                        <a-input class="bacClass" v-model="dataForm.validWidth" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="备注" field="remark">
                        <a-input class="bacClass" v-model="dataForm.remark" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="设备编号">
                        <a-input class="bacClass" v-model="dataForm.deviceCode" style="width:200px" />
                    </a-form-item>
                </a-col>

            </a-row>

            <a-row :span="4" justify="space-between">
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="班次">
                        <a-input class="bacClass" v-model="dataForm.shift" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="横缩(挂干)">
                        <a-input-number class="bacClass" v-model="dataForm.abscissHangDry" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="坯布编号">
                        <a-input class="bacClass" v-model="dataForm.greyCode" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="测试标准" field="verifyStandard"
                        :rules="[{ required: true, message: '测试标准必填' }]" :validate-trigger="['change', 'blur']">
                        <!-- <a-input class="bacClass" v-model="dataForm.verifyStandard" /> -->
                        <a-select popup-container="html"  class="bacClass" style="width:200px" v-model="dataForm.verifyStandard" allow-clear
                            @change="selectChangeVerify" allow-search @focus="selectChange(6)">
                            <a-option v-for="item in pageData.testStandardList" :value="item.verifyStandard"
                                :key="item.id">{{ item.verifyStandard }}</a-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="直缩(挂干)">
                        <a-input-number class="bacClass" v-model="dataForm.straightHangDry" style="width:200px" />
                    </a-form-item>
                </a-col>

            </a-row>
            <a-row :span="4" justify="space-between">
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="直缩(抛干)">
                        <a-input-number class="bacClass" v-model="dataForm.straightThrowDry" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="直缩(平干)">
                        <a-input-number class="bacClass" v-model="dataForm.straightFlatDry" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="横缩(抛干)">
                        <a-input-number class="bacClass" v-model="dataForm.abscissThrowDry" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="横缩(平干)">
                        <a-input-number class="bacClass" v-model="dataForm.abscissFlatDry" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="扭度(平干)">
                        <a-input-number class="bacClass" v-model="dataForm.torsionHangDry" style="width:200px" />
                    </a-form-item>
                </a-col>

            </a-row>
            <a-row :span="4" justify="space-between">
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="洗后克重(挂干)">
                        <a-input-number class="bacClass" v-model="dataForm.washWeightHangDry" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="洗后克重(抛干)">
                        <a-input-number class="bacClass" v-model="dataForm.washWeightThrowDry" style="width:200px" />
                    </a-form-item>
                </a-col>

                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="扭度(挂干)">
                        <a-input-number v-model="dataForm.torsionThrowDry" class="bacClass" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="扭度(抛干)">
                        <a-input-number v-model="dataForm.torsionFlatDry" class="bacClass" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="4" :xl="8" :lg="12" :md="12" :xs="24">
                    <a-form-item label-col-flex="120px" label="实测门幅" field="measuredWidth"
                        :rules="[{ required: true, message: '实测门幅必填' }]" :validate-trigger="['change', 'blur']">
                        <a-input class="bacClass" v-model="dataForm.measuredWidth" style="width:200px" />
                    </a-form-item>
                </a-col>
            </a-row>
            <a-row :gutter="24">

                <a-col :span="5">
                    <a-form-item label-col-flex="120px" label="实测克重" field="measuredWeight"
                        :rules="[{ required: true, message: '实测克重必填' }]" :validate-trigger="['change', 'blur']">
                        <a-input-number :min="0" class="bacClass" v-model="dataForm.measuredWeight" style="width:200px" />
                    </a-form-item>
                </a-col>
                <a-col :span="5">
                    <a-form-item label-col-flex="120px" label="洗后克重(平干)">
                        <a-input-number class="bacClass" v-model="dataForm.washWeightFlatDry" style="width:200px" />
                    </a-form-item>
                </a-col>
            </a-row>

        </a-form>
        <a-row style="margin: 0px 10px;">
            <el-button type="success" :icon="iconText.CirclePlus" @click="addForm"
                style="margin-bottom: 10px;background:#67c23a">新增</el-button>
            <!-- <el-button :icon="iconText.Delete" @click="delForm">删除</el-button> -->
        </a-row>
        <a-table size="small" :scrollbar="scrollbar" :columns="createResultColumns" :pagination="false"
            :data="dataForm.verifyManageDetail">
            <template #verifyType="{ rowIndex }">
                <a-input class="bacClass" v-model="dataForm.verifyManageDetail[rowIndex].verifyType" />
            </template>
            <template #verifyProject="{ rowIndex }">
                <a-input class="bacClass" v-model="dataForm.verifyManageDetail[rowIndex].verifyProject" />
            </template>
            <template #verifyMethod="{ rowIndex }">
                <a-input class="bacClass" v-model="dataForm.verifyManageDetail[rowIndex].verifyMethod" />
            </template>
            <template #fabicVerifyClass="{ rowIndex }">
                <a-input class="bacClass" v-model="dataForm.verifyManageDetail[rowIndex].fabicVerifyClass" />
            </template>
            <template #verifyMinNum="{ rowIndex }">
                <a-input-number class="bacClass" :min="0" v-model="dataForm.verifyManageDetail[rowIndex].verifyMinNum"
                    @change="() => handleChange(rowIndex)" />
            </template>
            <template #verifyMaxNum="{ rowIndex }">
                <a-input-number class="bacClass" :min="dataForm.verifyManageDetail[rowIndex].verifyMinNum"
                    v-model="dataForm.verifyManageDetail[rowIndex].verifyMaxNum" @change="() => handleChange(rowIndex)" />
            </template>
            <template #extandField="{ rowIndex }">
                <a-input class="bacClass" v-model="dataForm.verifyManageDetail[rowIndex].extandField" />
            </template>
            <template #remark="{ rowIndex }">
                <a-input class="bacClass" v-model="dataForm.verifyManageDetail[rowIndex].remark" />
            </template>
            <template #verifyResult="{ rowIndex }">
                <a-input-number class="bacClass" :min="0" v-model="dataForm.verifyManageDetail[rowIndex].verifyResult"
                    @change="() => handleChange(rowIndex)" />
            </template>
            <template #judgeResult="{ rowIndex }">
                <!-- <a-input class="bacClass" disabled v-model="dataForm.verifyManageDetail[rowIndex].judgeResult" /> -->
                <a-select popup-container="html"  class="bacClass" v-model="dataForm.verifyManageDetail[rowIndex].judgeResult" disabled>
                    <a-option :value="0">合格</a-option>
                    <a-option :value="1">不合格</a-option>
                </a-select>
            </template>
            <template #verifyStandard="{ rowIndex }">
                <a-input class="bacClass" v-model="dataForm.verifyManageDetail[rowIndex].verifyStandard" />
            </template>
            <template #orderRemark="{ rowIndex }">
                <a-input class="bacClass" v-model="dataForm.verifyManageDetail[rowIndex].otherRemark" />
            </template>
            <template #action="{ rowIndex }" v-if="dataForm.verifyManageDetail.length > 1">
                <el-button type="danger" @click="dataForm.verifyManageDetail.splice(rowIndex, 1)" link>删除</el-button>
            </template>
        </a-table>

        <template #footer>
            <a-button size="mini" @click="pageData.showAdd = false">
                关闭
            </a-button>
            <a-button type="primary" size="mini" @click="saveHandler">
                保存
            </a-button>
            <a-button type="primary" status="warning" size="mini" @click="toHasRowDataPrint(dataForm)" v-if="dataForm.id">
                打印
            </a-button>
        </template>
    </a-drawer>

    <a-drawer :drawer-style="{ zIndex: 10010 }" height="100%" unmountOnClose :visible="pageData2.showAdd"
        :mask-closable="false" placement="bottom" @cancel="pageData2.showAdd = false">
        <template #title>
            <a-row style="width:calc(100vw - 100px);justify-content: space-between;box-sizing: border-box;">
                <a-col flex="200px">缩水测试原始资料记录表</a-col>
                <a-col flex="100px">
                    <a-button type="primary" @click="SshuiSelect">查询</a-button>
                </a-col>
            </a-row>
        </template>
        <a-form size="small" :model="searchData" auto-label-width>
            <a-row :gutter="16">
                <a-col :xxl="6" :xl="12" :lg="12" :md="12" :xs="24">
                    <a-form-item label="开单日期">
                        <a-range-picker  popup-container="html"  style="width: 270px;" class="aInput" allow-clear v-model="pageData2.time" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="6" :xl="12" :lg="12" :md="12" :xs="24">
                    <a-form-item label="流转卡号">
                        <a-input class="aInput" allow-clear v-model="pageData2.circulatCard" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="6" :xl="12" :lg="12" :md="12" :xs="24">
                    <a-form-item label="记录单号">
                        <a-input class="aInput" allow-clear v-model="pageData2.verifyShrinkRegistCode" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="6" :xl="12" :lg="12" :md="12" :xs="24">
                    <a-form-item label="布号">
                        <a-input class="aInput" allow-clear v-model="pageData2.clothCode" />
                    </a-form-item>
                </a-col>
            </a-row>
            <a-row :gutter="16">
                <a-col :xxl="6" :xl="12" :lg="12" :md="12" :xs="24">
                    <a-form-item label="品名">
                        <a-input class="aInput" allow-clear v-model="pageData2.brandName" />
                    </a-form-item>
                </a-col>
                <a-col :xxl="6" :xl="12" :lg="12" :md="12" :xs="24">
                    <a-form-item label="客户名称">
                        <a-input class="aInput" allow-clear v-model="pageData2.customName" />
                    </a-form-item>
                </a-col>
            </a-row>
        </a-form>
        <AgGridVuesCopys :rowHeight="33" :headerHeight="33" :suppressCopyRowsToClipboard="true" rowSelection="multiple"
            @grid-ready="gridReady" style="height:85%;z-index:10020" class='ag-theme-alpine' :defaultColDef="defaultColDef"
            :rowData="pageData2.dataList" :columnDefs="cfsValue" :localeText="localeTextData" />
        <paginationCopys :total="pageData2.total" show-total show-jumper show-page-size @change="CsChangePage"
            @page-size-change="CsChangeSize" style="justify-content: center;margin-top: 10px;" :page-size="pageData2.size"
            :current="pageData2.page" />
        <template #footer>
            <a-button size="mini" @click="pageData2.showAdd = false">
                关闭
            </a-button>
            <a-button type="primary" size="mini" @click="SsAddSopit">
                确定
            </a-button>
        </template>
    </a-drawer>
</template>
 
<script lang="ts">
import { reactive, ref, onMounted, watch } from 'vue'
import { useTable, useRowKey, useTableColumn, usePagination, useRowSelection } from '@/hooks/table'
import { FormInstance, Message, Modal } from '@arco-design/web-vue';
import { pageDataInterface, PhyManage, searchManageData } from '@/interface/phyManageInterface'
import { verfiyShrinkReg, verifyManage } from '@/api/PhysicalSurveyRoom/physicalTestApi'
import { testStandardProject, testType } from '@/api/PhysicalSurveyRoom/basicDataApi'
import { orderFn as labOtherFn } from '@/api/laboratory/other'
import { otherFn as phyOtherFn } from '@/api/PhysicalSurveyRoom/other'
import PhyLabelPrint from './phyLabelPrint.vue';
import PageTabelLayout from '@/components/pageTabelLayout.vue';
import PhyManageUnApproved from './phyManageUnApproved.vue';
import emitter from "@/hooks/useEventBus";
import { selectDataFn } from '@/api/DyeingshopManagement/getOrderFn';
import { post } from '@/api/http'

import { localeText } from '@/api/aggridZw'
import { slicing } from '@/utils/caseFrimAndSecRig'

import {
    CirclePlus,
    Delete
} from '@element-plus/icons-vue'
import dayjs from 'dayjs';
export default {
    name: "phyManageList",
    expose: ['auditIds'],
    setup() {
        onMounted(() => {
            selectHandler();
            // 第一个页面需要在刚进入就调用一次  切换tap时也需要调用
            emitter.on("refresh-phyManageList", () => {
                selectHandler();
            })

        });
        let iconText: any = {
            CirclePlus,
            Delete
        };
        let auditState = ref<number>(1);
        let resultState = ref<number>(1);
        let headerShow = ref<boolean>(true);
        let changHeadShow = (boolVal: boolean) => {
            headerShow.value = boolVal;
            emitter.emit('window-change');
        }
        //下拉数据
        const options = ref<any>();
        const loading = ref(false);
        const searchHandler = async (value: any, index: number) => {
            if (value) {
                loading.value = true;
                await selectChange(index, value, (data: any) => {
                    options.value = data;
                });
                loading.value = false;
            }
            else {
                options.value = [];
            }
        };
        const selectChange = async (selectIndex: number, value: any = "", cb = (data: any) => { return data; }) => {
            switch (selectIndex) {
                case 1:
                    //获取类型列表
                    await testType().getSelectTestTypeList({ verifyType: value }).then(res => {
                        if (res.code === 200) {
                            pageData.testTypeList = res.data;
                            cb(res.data);
                        }
                        else {
                            Message.error({
                                content: "查询失败！",
                                duration: 5000,
                            });
                        }
                    });
                    break;
                case 2:
                    //获取部门列表
                    await selectDataFn().getTreeDepart({}).then(res => {
                        if (res.code === 200) {
                            pageData.departList = res.data;
                            cb(res.data);
                        }
                        else {
                            Message.error({
                                content: "查询失败！",
                                duration: 5000,
                            });
                        }
                    });
                    break;
                case 3:
                    //获取员工列表
                    await phyOtherFn().getEmployeeList({ name: value, }).then(res => {
                        //  console.log(res.data);
                        if (res.code === 200) {
                            pageData.employeeList = res.data;
                            cb(res.data);
                        } else {
                            Message.error({
                                content: "查询失败！",
                                duration: 5000,
                            });
                        }
                    });
                    break;
                case 4:
                    //获取流转卡号下拉列表信息数据
                    await labOtherFn().getCirculCardList({ flowCardCode: value, }).then(res => {
                        if (res.code === 200) {
                            pageData.circulDropList = res.data;
                            cb(res.data);
                        }
                        else {
                            Message.error({
                                content: "查询失败！",
                                duration: 5000,
                            });
                        }
                    });
                    break;
                case 5:
                    //获取计划单号列表信息
                    await labOtherFn().getPlanInfoList({ planOrderCode: value }).then(res => {
                        if (res.code === 200) {
                            pageData.planCodeList = res.data;
                            cb(res.data);
                        } else {
                            Message.error({
                                content: "查询失败！",
                                duration: 5000,
                            });
                        }
                    });
                case 6:
                    await testStandardProject().getSelectTestStandardProjectList({ client: dataForm.customName }).then(res => {
                        if (res.code === 200) {
                            // console.log(res.data);
                            pageData.testStandardList = res.data;
                            cb(res.data);
                        } else {
                            Message.error({
                                content: "查询失败！",
                                duration: 5000,
                            });
                        }
                    });
                    break;
            }
        };
        const verifyManageApi = verifyManage();
        //根据选中的类型返回对应信息
        const selectChangeVerify = async (data: any) => {
            // dataForm.verifyManageDetail = [{ ...verifyItem }];
            // if (data) {
            //     let obj = { customVerifyProjectId: '' };
            //     pageData.testStandardList.forEach((v) => {
            //         if (v.verifyStandard === data) {
            //             obj.customVerifyProjectId = v.id
            //         };
            //     });
            //     await testStandardProject().getByIdNextPageProjectList(obj).then((res: any) => {
            //         if (res.code === 200) {
            //             let list = res.data;
            //             let vals = list.map((vItem: any) => {
            //                 return {
            //                     verifyType: vItem.verifyType,
            //                     fabicVerifyClass: vItem.fabiceVerifyClass,
            //                     verifyMethod: vItem.testMethod,
            //                     extandField: vItem.extandField,
            //                     verifyMinNum: vItem.verifyMinNum,
            //                     verifyMaxNum: vItem.verifyMaxNum,
            //                     verifyProject: vItem.fabricTestItem,
            //                     remark: vItem.remark,
            //                     verifyStandard: dataForm.verifyStandard
            //                 }
            //             });
            //             dataForm.verifyManageDetail.forEach((v, i, arr) => {
            //                 vals.forEach((item: any, s: any) => {
            //                     arr[s] = { ...v, ...item }
            //                 })
            //             });
            //         } else {
            //             Message.error({
            //                 content: res.message,
            //                 duration: 5000,
            //             });
            //         }
            //     });
            // }
            post({
                url: 'pdm/VerifyManage/getCustomVerifyProject',
                data: {
                    customName: dataForm.customName,
                    verifyStandard: dataForm.verifyStandard,
                }
            }).then((res: any) => {
                dataForm.verifyManageDetail = res.data
            })
        }
        const addHandler = () => {

            for (var key in dataForm) {
                if (key === "id") {
                    dataForm[key] = null;
                }
                else if (key == "serialNo") {
                    dataForm[key] = 0;
                }
                else if (!Array.isArray(dataForm[key])) {
                    dataForm[key] = "";
                }
                else {
                    dataForm[key].forEach((v: any) => {
                        for (var prop in v) {
                            if (prop === "id") {
                                v[prop] = null;
                            }
                            else {
                                v[prop] = "";
                            }
                        }
                    });
                }
            };
            dataForm.verifyManageDate = dayjs(Date.now()).format('YYYY-MM-DD hh:mm:ss');
            dataForm.department = "物测部";
            jlDh()
            BMYG()
            pageData.showAdd = true;
            pageData.sideTitle = "新增物测管理";
        };
        const selectHandler = () => {
            if (auditState.value === 1) {
                emitter.emit('refresh-phyManageUnApproved')
            } else {
                emitter.emit('refresh-phyManageApproved')
            }

            if (resultState.value === 1) {
                emitter.emit('refresh-phyMeasurResult')
            } else {
                console.log('+++++++++++++')
                emitter.emit('refresh-phyMeasurChart')
            }
        };
        const changHandler = (e: number | string) => {
            auditState.value = +e;
            selectHandler();
        };
        const secondChangeHandler = (e: number | string) => {
            resultState.value = +e;
            selectHandler();
        };
        const exportHandler = () => {
            if (auditState.value === 1) {
                emitter.emit('export-phyManageUnApproved')
            } else {
                emitter.emit('export-phyManageApproved')
            }

        };

        const hasAudit = async (auditIds: any) => {
            let auIds = auditIds.map((v: any) => { return v.id });
            if (auIds.length > 0) {
                Modal.confirm({
                    title: "提示",
                    content: `确定要${auditState.value > 1 ? "驳回审核" : "审核"}选中数据吗？`,
                    cancelText: "取消",
                    okText: "审核",
                    onOk: async () => {
                        let data = auIds.map((item: any) => {
                            return {
                                id: item,
                                auditState: auditState.value
                            };
                        });
                        await verifyManageApi.setAuditVerfiyManage([...data]).then((res: any) => {
                            if (res.code === 200) {
                                Message.success({
                                    content: res.message || "操作成功",
                                    duration: 2000
                                });
                                selectHandler();
                                // selectedRowKeys.value = [];
                            }
                            else {
                                Message.error({
                                    content: res.message,
                                    duration: 2000
                                });
                            }
                        });
                    },
                });
            } else {
                Message.info("请选择需要审核的数据");
            }
        };
        const auditHandler = () => {
            if (auditState.value === 1) {
                emitter.emit('changUnApprovedRows')
            } else {
                emitter.emit('changApprovedRows')
            }
            // emitter.emit('');
        };
        //打印
        const toHasRowDataPrint = (data: any) => {
            pageData.phyData = data;
            pageData.showPrint = true;
        }
        const dyBoufeiHandler = () => {
            if (auditState.value === 1) {
                emitter.emit('print-phyManageUnApproved')
            } else {
                emitter.emit('print-phyManageApproved')
            }
        };
        const toHasRowDataEdit = (data: any) => {
            pageData.showAdd = true;
            pageData.sideTitle = "编辑物测管理";
            for (let key in data) {
                dataForm[key] = data[key];
            }
            post({
                url: 'pdm/VerifyManageDetail/getList',
                data: {
                    verifyManageId: data.id
                }
            }).then(({ data }) => {
                dataForm.verifyManageDetail = data
            })
        };
        const printDataClick = (data: any) => {
            pageData.phyData = data;
            pageData.showPrint = true;
        };
        const pushMessHandler = async (pushState: number) => {
            if (!pageData.pushDepartment && !pageData.pushVerifyType && !pageData.pusher) {
                Message.error({
                    content: "缺少推送信息(推送人员，推送部门，推送类型)",
                    duration: 3000,
                });
                return;
            }
            await verifyManageApi.pushAndWithdrawalVerfiyMessage([{ pushState, pushDepartment: pageData.pushDepartment, pusher: pageData.pusher, pushVerifyType: pageData.pushVerifyType, id: dataForm.id }]).then((res: any) => {
                if (res.code === 200) {
                    Message.success({
                        content: res.message || "操作成功",
                        duration: 2000
                    });
                    closePop();
                    // selectedRowKeys.value = [];
                }
                else {
                    Message.error({
                        content: res.message,
                        duration: 2000
                    });
                }
            });
        };
        const formRef = ref<FormInstance>();
        const scrollbar = ref(true);
        const { selectedRowKeys } = useRowSelection();
        const rowKey = useRowKey("id");
        const table = useTable();
        const saveHandler = () => {
            // console.log('保存一下',formRef.value?.validate())
            formRef.value?.validate().then(async (err) => {
                console.log(dataForm);
                if (!err) {
                    if (!dataForm.id) {
                        await verifyManageApi.addVerifyManage({ ...dataForm }).then((res: any) => {
                            if (res.code === 200) {
                                formRef.value?.resetFields();
                                Message.success({
                                    content: "新增成功",
                                    duration: 5000,
                                });
                                closePop();
                            }
                            else {
                                Message.error({
                                    content: res.message,
                                    duration: 5000,
                                });
                            }
                        });
                    }
                    else {
                        await verifyManageApi.editVerifyManage({ ...dataForm }).then((res: any) => {
                            if (res.code === 200) {
                                formRef.value?.resetFields();
                                Message.success({
                                    content: "编辑成功",
                                    duration: 5000,
                                });
                                closePop();
                            }
                            else {
                                Message.error({
                                    content: res.message,
                                    duration: 5000,
                                });
                            }
                        });
                    }
                }
                else {
                    console.log(err);
                }
            });
        };
        const closePop = () => {
            pageData.showAdd = false;
            selectHandler();
        };
        // const importHandler = async (circulatCard: any) => {
        //     if (circulatCard) {
        //         let res: any = await verfiyShrinkReg().getShrinkObj({ auditState: 1, circulatCard, });
        //         if (res.code === 200) {
        //             let data = res.data;
        //             if (data.length > 0) {
        //                 for (let key in data[0]) {
        //                     dataForm[key] = data[key];
        //                 }
        //             } else {
        //                 Message.error({
        //                     content: "暂无对应的缩水记录表",
        //                     duration: 5000,
        //                 });
        //             }
        //         } else {
        //             Message.error({ content: res.message })
        //         }
        //     } else {
        //         Message.error({
        //             content: "请选择流转卡号",
        //             duration: 5000,
        //         });
        //     }

        // };
        const casObDepart = ref();
        const cascaderChangeDepart = () => {
            setTimeout(function () {
                if (casObDepart.value.selectViewValue.length != 0) {
                    dataForm.department = slicing(casObDepart.value.selectViewValue[0]['label'])
                }
            }, 100)
        };
        const casObPushDepart = ref();
        const cascaderChangePushDepart = () => {
            setTimeout(function () {
                if (casObPushDepart.value.selectViewValue.length != 0) {
                    pageData.pushDepartment = slicing(casObPushDepart.value.selectViewValue[0]['label'])
                }
            }, 100)
        };

        const tableRowClassName = (row: any, index: number) => {
            row.row.index = row.rowIndex;
        };

        const addForm = () => {
            dataForm.verifyManageDetail.push({
                ...verifyItem
            });
        };

        const circulRef = ref();
        const changeCircul = () => {
            setTimeout(() => {
                pageData.circulDropList.forEach((v: any) => {
                    if (v.flowCardCode === circulRef.value.modelValue) {
                        dataForm.customName = v.customName;
                        dataForm.colorCode = v.colorCode;
                        dataForm.colorName = v.colorName;
                        dataForm.clothCode = v.clothCode;
                        dataForm.weight = v.flowCardWeight;
                        dataForm.yarnCount = v.houseNum;
                        dataForm.greyCode = v.greyCode;
                        hasCode(v.clothCode);
                    }
                })
            }, 100)
        }

        const huiche = () => {
            if (dataForm.circulatCard) {
                post({
                    url: 'pdm/VerifyManage/getCirculatCard',
                    data: {
                        circulatCard: dataForm.circulatCard
                    }
                }).then(({ code, data, message }) => {
                    if (code == 200) {
                        if (data.length == 0) {
                            Message.error('无该流转卡数据')
                            return
                        } else {
                            // for(let item in data[0]){
                            //     dataForm[item] = data[0].item
                            // }
                            dataForm.customName = data[0].customName;
                            dataForm.colorCode = data[0].colorCode;
                            dataForm.colorName = data[0].colorName;
                            dataForm.clothCode = data[0].clothCode;
                            dataForm.weight = data[0].weight;
                            dataForm.yarnCount = data[0].yarnCount;
                            dataForm.brandName = data[0].brandName;
                            dataForm.requireWidth = Number(data[0].requireWidth);
                            dataForm.requireWeight = Number(data[0].requireWeight);
                            dataForm.greyCode = data[0].greyCode;
                            dataForm.pieceNum = data[0].pieceNum;
                            dataForm.planCode = data[0].planCode;
                            dataForm.verifyStandard = data[0].verifyStandard;
                            post({
                                url: 'pdm/VerifyManage/getCustomVerifyProject',
                                data: {
                                    customName: dataForm.customName,
                                    verifyStandard: dataForm.verifyStandard,
                                }
                            }).then((res: any) => {
                                dataForm.verifyManageDetail = res.data
                            })
                        }

                    } else {
                        Message.error(message)
                        return
                    }
                })
            } else {
                Message.error('请输入流转卡')
            }
        }
        //记录单号
        function jlDh() {
            post({
                url: 'pdm/VerifyManage/getCodeGenerate',
                data: {}
            }).then(({ data }) => {
                dataForm.verifyManageCode = data
            })
        }

        //部门员工
        function BMYG() {
            post({
                url: 'admin/acl/user/findUserToken',
                data: {}
            }).then(({ data }) => {
                dataForm.department = data.data.empMap.department
                dataForm.documenter = data.data.empMap.name
            })
        }

        const changCode = (data: any) => {
            hasCode(data);
        };

        const hasCode = async (clothCode: any) => {
            await phyOtherFn().getDevList({ clothCode }).then((res: any) => {
                if (res.code === 200) {
                    if (res.data.length > 0) {
                        let data = res.data[0];
                        dataForm.requireWidth = data.fabricWidth;
                        dataForm.requireWeight = data.fabricWeight;
                    }
                } else {
                    Message.error({
                        content: "查询失败！",
                        duration: 5000,
                    });
                }
            });
        };

        const verifyItem = {
            verifyType: "",
            verifyProject: "",
            verifyMethod: "",
            fabicVerifyClass: "",
            verifyMinNum: 0,
            verifyMaxNum: 0,
            extandField: "",
            remark: "",
            verifyResult: 0,
            judgeResult: "",
            verifyStandard: "",
            otherRemark: "",
        };

        const dataForm = reactive<PhyManage>({
            id: null,
            department: "",
            verifyManageDate: "",
            verifyManageCode: '',
            circulatCard: "",
            customName: "",
            colorCode: "",
            colorName: "",
            clothCode: "",
            brandName: "",
            weight: 0,
            pieceNum: "",
            yarnCount: "",
            burstStrength: 0,
            verifyResult: 0,
            requireWidth: 0,
            requireWeight: 0,
            measuredWidth: "",
            measuredWeight: 0,
            validWidth: "",
            planCode: "",
            documenter: "",
            customOrderNo: "",
            deviceCode: "",
            shift: "",
            greyCode: "",
            verifyStandard: "",
            abscissHangDry: 0,
            straightHangDry: 0,
            torsionHangDry: 0,
            washWeightHangDry: 0,
            abscissThrowDry: 0,
            straightThrowDry: 0,
            torsionThrowDry: 0,
            washWeightThrowDry: 0,
            abscissFlatDry: 0,
            straightFlatDry: 0,
            torsionFlatDry: 0,
            washWeightFlatDry: 0,
            remark: "",
            verifyManageDetail: [{
                ...verifyItem
            }],
        });

        const rangePicckerChange = (date: any) => {
            searchData.beginDate = date ? date[0] : '';
            searchData.endDate = date ? date[1] : '';
        };
        const searchData: any = reactive({
            beginDate: "",
            endDate: "",
            clothCode: "",
            brandName: "",
            circulatCard: "",
            planCode: "",
            customName: "",
            // verifyResult: 0
        });
        const pageData = reactive<pageDataInterface>({
            showAdd: false,
            showPrint: false,
            sideTitle: "新增物测管理",
            pageLoading: false,
            departList: [],
            employeeList: [],
            testTypeList: [],
            pushDepartment: "",
            pusher: "",
            pushVerifyType: "",
            circulDropList: [],
            planCodeList: [],
            phyResultSunnaryList: [],
            departTitle: '',
            pushDepartTitle: '',
            phyData: {},
            testStandardList: []
        });
        //物测结果(创建)
        const createResultColumns = useTableColumn([
            {
                title: "测试类型",
                key: "verifyType",
                dataIndex: "verifyType",
                slotName: "verifyType",
                width: 150,
            },
            {
                title: "测试项目",
                key: "verifyProject",
                dataIndex: "verifyProject",
                slotName: "verifyProject",
                width: 150,
            },
            {
                title: "测试方法",
                key: "verifyMethod",
                dataIndex: "verifyMethod",
                slotName: "verifyMethod",
                width: 150,
            },
            {
                title: "面料测试大类",
                key: "fabicVerifyClass",
                dataIndex: "fabicVerifyClass",
                slotName: "fabicVerifyClass",
                width: 150,
            },
            {
                title: "面料测试要求最小值",
                key: "verifyMinNum",
                dataIndex: "verifyMinNum",
                slotName: "verifyMinNum",
                width: 160,
            },
            {
                title: "面料测试要求最大值",
                key: "verifyMaxNum",
                dataIndex: "verifyMaxNum",
                slotName: "verifyMaxNum",
                width: 160,
            },
            {
                title: "可选项",
                key: "extandField",
                dataIndex: "extandField",
                slotName: "extandField",
                width: 150,
            },
            {
                title: "备注",
                key: "remark",
                dataIndex: "remark",
                slotName: "remark",
                width: 150,
            },
            {
                title: "测试结果",
                key: "verifyResult",
                dataIndex: "verifyResult",
                slotName: "verifyResult",
                width: 200,
            },
            {
                title: "评判结果",
                key: "judgeResult",
                dataIndex: "judgeResult",
                slotName: "judgeResult",
                width: 150,
            },
            {
                title: "测试标准",
                key: "verifyStandard",
                dataIndex: "verifyStandard",
                slotName: "verifyStandard",
                width: 150,
            },
            {
                title: "其他备注",
                key: "orderRemark",
                dataIndex: "orderRemark",
                slotName: "orderRemark",
                width: 150,
            },
            {
                title: "操作",
                key: "id",
                dataIndex: "id",
                slotName: "action",
                width: 150,
                fixed: "right",
            },
        ]);
        const handleChange = (rowIndex: number) => {
            if (dataForm.verifyManageDetail[rowIndex]?.verifyResult >= dataForm.verifyManageDetail[rowIndex]?.verifyMinNum && dataForm.verifyManageDetail[rowIndex]?.verifyResult <= dataForm.verifyManageDetail[rowIndex]?.verifyMaxNum) {
                dataForm.verifyManageDetail[rowIndex].judgeResult = 0;
            } else {
                dataForm.verifyManageDetail[rowIndex].judgeResult = 1;
            };
        };

        const dels = () => {
            emitter.emit('delShanc')
        }

        emitter.on('hasDel', (res: any) => {
            if (res.length == 0) {
                Message.error('请勾选数据')
                return
            }
            Modal.confirm({
                title: '系统提示',
                content: '确认删除选中的数据?',
                onOk: () => {
                    post({
                        url: 'pdm/VerifyManage/delete ',
                        data: res.map((resz: any) => resz.id)
                    }).then((ddd: any) => {
                        if (ddd.code == 200) {
                            Message.success('删除成功')
                            emitter.emit('refresh-phyManageUnApproved')
                        } else (
                            Message.error(ddd.message)
                        )
                    })
                },
            })
        })
        const localeTextData: any = ref(localeText);
        const defaultColDef = {
            sortable: true,
            resizable: true,
            filter: true,
            width: 150
        };

        const gridOption = ref();
        const gridReady = (params: any) => {
            gridOption.value = params.api;
            //调整表格自适应大小
        }

        let cfsValue: any = [
            {
                headerName: "序号",
                key: "serialNo",
                field: "serialNo",
            },
            {
                headerName: "开单日期",
                key: "billDate",
                field: "billDate",
            },
            {
                headerName: "记录单号",
                key: "verifyShrinkRegistCode",
                field: "verifyShrinkRegistCode",
            },
            {
                headerName: "流转卡号",
                key: "circulatCard",
                field: "circulatCard",
                slotName: "circulatCard",
            },
            {
                headerName: "客户",
                key: "customName",
                field: "customName",
                slotName: "customName",
            },
            {
                headerName: "布号",
                key: "clothCode",
                field: "clothCode",
                slotName: "clothCode",
            },
            {
                headerName: "品名",
                key: "brandName",
                field: "brandName",
                slotName: "brandName",
            },
            {
                headerName: "颜色深浅",
                key: "colorDepth",
                field: "colorDepth",
                slotName: "colorDepth",
            },
            {
                headerName: "色号",
                key: "colorCode",
                field: "colorCode",
                slotName: "colorCode",
            },
            {
                headerName: "色称",
                key: "colorName",
                field: "colorName",
                slotName: "colorName",
            },
            {
                headerName: "合约号",
                key: "contractNo",
                field: "contractNo",
                slotName: "contractNo",
            },
            {
                headerName: "客户订单号",
                key: "customOrderNo",
                field: "customOrderNo",
                slotName: "customOrderNo",
            },
            {
                headerName: "坯布批号",
                key: "greyBatch",
                field: "greyBatch",
                slotName: "greyBatch",
            },
            {
                headerName: "坯布名称",
                key: "greyName",
                field: "greyName",
                slotName: "greyName",
            },
            {
                headerName: "匹数",
                key: "pieceNum",
                field: "pieceNum",
                slotName: "pieceNum",
            },
            {
                headerName: "设备编号",
                key: "deviceCode",
                field: "deviceCode",
                slotName: "deviceCode",
            },
            {
                headerName: "定型机台",
                key: "shapMachine",
                field: "shapMachine",
                slotName: "shapMachine",
            },
            {
                headerName: "预缩",
                key: "preshrunk",
                field: "preshrunk",
                slotName: "preshrunk",
            },
            {
                headerName: "重量",
                key: "weight",
                field: "weight",
                slotName: "weight",
            },
            {
                headerName: "胚洗前",
                key: "embWashBefore",
                children: [
                    {
                        headerName: "克重",
                        field: "firstGreyWashWeight",
                        slotName: "firstGreyWashWeight",

                    },
                    {
                        headerName: "门幅",
                        field: "firstGreyWashWidth",
                        slotName: "firstGreyWashWidth",

                    },
                ]
            },
            {
                headerName: "胚洗后",
                key: "embWashAfter",
                children: [
                    {
                        headerName: "克重",
                        field: "afterGreyWashWeight",
                        slotName: "afterGreyWashWeight",

                    },
                    {
                        headerName: "门幅",
                        field: "afterGreyWashWidth",
                        slotName: "afterGreyWashWidth",

                    },
                ]
            },
            {
                headerName: "定前",
                key: "finalizeBefore",
                children: [
                    {
                        headerName: "克重",
                        field: "firstSetWeight",
                        slotName: "firstSetWeight",

                    },
                    {
                        headerName: "门幅",
                        field: "firstSetWidth",
                        slotName: "firstSetWidth",

                    },
                ]
            },
            {
                headerName: "还原",
                key: "reduction",
                children: [
                    {
                        headerName: "克重",
                        field: "reductionWeight",
                        slotName: "reductionWeight",

                    },
                    {
                        headerName: "门幅",
                        field: "reductionWidth",
                        slotName: "reductionWidth",

                    },
                ]
            },
            {
                headerName: "定后",
                key: "finalizeAfter",
                field: "finalizeAfter",
                children: [
                    {
                        headerName: "克重",
                        field: "afterSetWeight",
                        slotName: "afterSetWeight",

                    },
                    {
                        headerName: "门幅",
                        field: "afterSetWidth",
                        slotName: "afterSetWidth",

                    },
                ]
            },
            {
                headerName: "水洗尺寸变化率类型",
                key: "washSizeChangeRateType",
                field: "washSizeChangeRateType",
                slotName: "washSizeChangeRateType",
            },
            {
                headerName: "洗前横向(%)",
                key: "washHorizontalBefore",
                children: [
                    {
                        headerName: "1",
                        field: "firstWashTransverse1",
                        slotName: "firstWashTransverse1",

                    },
                    {
                        headerName: "2",
                        field: "firstWashTransverse2",
                        slotName: "firstWashTransverse2",

                    },
                    {
                        headerName: "3",
                        field: "firstWashTransverse3",
                        slotName: "firstWashTransverse3",

                    },
                    {
                        headerName: "平均值",
                        field: "firstWashTransverseAvg",
                        slotName: "firstWashTransverseAvg",

                    },
                ]
            },
            {
                headerName: "洗前直向(%)",
                key: "washStraightBefore",
                children: [
                    {
                        headerName: "1",
                        field: "firstWashStraight1",
                        slotName: "firstWashStraight1",

                    },
                    {
                        headerName: "2",
                        field: "firstWashStraight2",
                        slotName: "firstWashStraight2",

                    },
                    {
                        headerName: "3",
                        field: "firstWashStraight3",
                        slotName: "firstWashStraight3",

                    },
                    {
                        headerName: "平均值",
                        field: "firstWashStraightAvg",
                        slotName: "firstWashStraightAvg",

                    },
                ]
            },
            {
                headerName: "洗后横向(%)",
                key: "washHorizontalAfter",
                children: [
                    {
                        headerName: "1",
                        field: "afterWashTransverse1",
                        slotName: "afterWashTransverse1",

                    },
                    {
                        headerName: "2",
                        field: "afterWashTransverse2",
                        slotName: "afterWashTransverse2",

                    },
                    {
                        headerName: "3",
                        field: "afterWashTransverse3",
                        slotName: "afterWashTransverse3",

                    },
                    {
                        headerName: "平均值",
                        field: "afterWashTransverseAvg",
                        slotName: "afterWashTransverseAvg",

                    },
                ]
            },
            {
                headerName: "洗后直向%",
                key: "washStraightAfter",
                children: [
                    {
                        headerName: "1",
                        field: "afterWashStraight1",
                        slotName: "afterWashStraight1",

                    },
                    {
                        headerName: "2",
                        field: "afterWashStraight2",
                        slotName: "afterWashStraight2",

                    },
                    {
                        headerName: "3",
                        field: "afterWashStraight3",
                        slotName: "afterWashStraight3",

                    },
                    {
                        headerName: "平均值",
                        field: "afterWashStraightAvg",
                        slotName: "afterWashStraightAvg",

                    },
                ]
            },
            {
                headerName: "缩水率(挂干)",
                key: "shrinkageHangdry",
                children: [
                    {
                        headerName: "横向(%)",
                        field: "shrinkageHangDryTransverse",
                        slotName: "shrinkageHangDryTransverse",

                    },
                    {
                        headerName: "直向(%)",
                        field: "shrinkageHangDryStraight",
                        slotName: "shrinkageHangDryStraight",

                    },
                ]
            },
            {
                headerName: "缩水率(抛干)",
                key: "shrinkageFlatdry",
                children: [
                    {
                        headerName: "横向(%)",
                        field: "shrinkageThrowDryTransverse",
                        slotName: "shrinkageThrowDryTransverse",

                    },
                    {
                        headerName: "直向(%)",
                        field: "shrinkageThrowDryStraight",
                        slotName: "shrinkageThrowDryStraight",

                    },
                ]
            },
            {
                headerName: "缩水率(平干)",
                key: "shrinkageFlatdry",
                children: [
                    {
                        headerName: "横向(%)",
                        field: "shrinkageFlatDryTransverse",
                        slotName: "shrinkageFlatDryTransverse",

                    },
                    {
                        headerName: "直向(%)",
                        field: "shrinkageFlatDryStraight",
                        slotName: "shrinkageFlatDryStraight",

                    },
                ]
            },
            {
                headerName: "扭度(挂干)%",
                key: "torsionHangDry",
                field: "torsionHangDry",
                slotName: "torsionHangDry",
            },
            {
                headerName: "扭度(抛干)%",
                key: "torsionThrowDry",
                field: "torsionThrowDry",
                slotName: "torsionThrowDry",
            },
            {
                headerName: "扭度(平干)%",
                key: "torsionFlatDry",
                field: "torsionFlatDry",
                slotName: "torsionFlatDry",
            },
            {
                headerName: "洗后克重(挂干)%",
                key: "washWeightHangDry",
                field: "washWeightHangDry",
                slotName: "washWeightHangDry",
            },
            {
                headerName: "洗后克重(抛干)%",
                key: "washWeightThrowDry",
                field: "washWeightThrowDry",
                slotName: "washWeightThrowDry",
            },
            {
                headerName: "洗后克重(平干)%",
                key: "washWeightFlatDry",
                field: "washWeightFlatDry",
                slotName: "washWeightFlatDry",
            },
            {
                headerName: "要求门幅",
                key: "requireWidth",
                field: "requireWidth",
                slotName: "requireWidth",
            },
            {
                headerName: "有效门幅",
                key: "validWidth",
                field: "validWidth",
                slotName: "validWidth",
            },
            {
                headerName: "要求克重",
                key: "requireWeight",
                field: "requireWeight",
                slotName: "requireWeight",
            },
            {
                headerName: "实测克重",
                key: "measuredWeight",
                field: "measuredWeight",
                slotName: "measuredWeight",
            },
            {
                headerName: "顶破强力",
                key: "burstStrength",
                field: "burstStrength",
                slotName: "burstStrength",
            },
            {
                headerName: "胀破强力",
                key: "dilapidationStrength",
                field: "dilapidationStrength",
                slotName: "dilapidationStrength",
            },
            {
                headerName: "耐日晒色牢度",
                field: "SunColorFastness",
            },
            {
                headerName: "耐酚黄色牢度",
                key: "phenolYellowColorFastness",
                field: "phenolYellowColorFastness",
                slotName: "phenolYellowColorFastness",
            },
            {
                headerName: "PH值",
                key: "phValue",
                field: "phValue",
                slotName: "phValue",
            },
            {
                headerName: "甲醛",
                key: "formaldehyde",
                field: "formaldehyde",
                slotName: "formaldehyde",
            },
            {
                headerName: "纬斜",
                key: "latitudinalObliquity",
                field: "latitudinalObliquity",
                slotName: "latitudinalObliquity",
            },
            {
                headerName: "耐光、汗复合色牢度",
                key: "colourAndLightPerspiration",
                children: [
                    {
                        headerName: "酸",
                        field: "lightSweatColorFastnessSour",
                        slotName: "lightSweatColorFastnessSour",

                    },
                    {
                        headerName: "碱",
                        field: "lightSweatColorFastnessAlkali",
                        slotName: "lightSweatColorFastnessAlkali",

                    },
                ]
            },
            {
                headerName: "泡水",
                key: "soakWater",
                field: "soakWater",
                slotName: "soakWater",
            },
            {
                headerName: "纵密(CPI)",
                key: "verticalDensityCPI",
                field: "verticalDensityCPI",
                slotName: "verticalDensityCPI",
            },
            {
                headerName: "横密(WPI)",
                key: "transverseDensityCPI",
                field: "transverseDensityCPI",
                slotName: "transverseDensityCPI",
            },
            {
                headerName: "耐摩擦色牢度",
                key: "rubbingColourFastness",
                children: [
                    {
                        headerName: "干",
                        field: "frictionColorFastnessDry",
                        slotName: "frictionColorFastnessDry",

                    },
                    {
                        headerName: "湿(浅色)",
                        field: "frictionColorFastnessWetTint",
                        slotName: "frictionColorFastnessWetTint",

                    },
                    {
                        headerName: "湿(深色)",
                        field: "frictionColorFastnessWetDark",
                        slotName: "frictionColorFastnessWetDark",

                    },
                ]
            },
            {
                headerName: "耐皂洗色牢度",
                key: "soapWashColorFastness",
                field: "soapWashColorFastness",
                slotName: "soapWashColorFastness",
            },
            {
                headerName: "耐汗渍色牢度",
                key: "perspirationColourFastness",
                children: [
                    {
                        headerName: "酸",
                        field: "stainColorFastnessSour",
                        slotName: "stainColorFastnessSour",

                    },
                    {
                        headerName: "碱",
                        field: "stainColorFastnessAlkali",
                        slotName: "stainColorFastnessAlkali",

                    },
                ]
            },
            {
                headerName: "耐水色牢度",
                key: "waterColorFastness",
                field: "waterColorFastness",
                slotName: "waterColorFastness",
            },
            {
                headerName: "扛起球",
                key: "resistPill",
                field: "resistPill",
                slotName: "resistPill",
            },
            {
                headerName: "耐唾液色牢度",
                key: "salivaColorFastness",
                field: "salivaColorFastness",
                slotName: "salivaColorFastness",
            },
            {
                headerName: "备注",
                key: "remark",
                field: "remark",
                slotName: "remark",
            },
            {
                headerName: "用量",
                key: "consumption",
                field: "consumption",
                slotName: "consumption",
            },
            {
                headerName: "测试标准",
                key: "verifyStandard",
                field: "verifyStandard",
                slotName: "verifyStandard",
            },
            {
                headerName: "审核状态",
                field: "auditState",
                cellRenderer: {
                    template: `<div>已审核</div>`,
                }
            },

            {
                headerName: "审核人",
                field: "auditPerson",
            },
            {
                headerName: "审核日期",
                field: "auditDate",
                width: 170,
            },
            {
                headerName: "创建人",
                field: "createName",
                width: 170,
            },
            {
                headerName: "创建时间",
                field: "createTime",
                width: 170,
            },
            {
                headerName: "修改人",
                field: "updateName",
                width: 170,
            },
            {
                headerName: "修改时间",
                field: "updateTime",
                width: 170,
            },
        ];
        let a = [{
            showRowGroup: 'hide_def',
            "headerName": "",
            "checkboxSelection": true,
            "headerCheckboxSelection": true,
            "pinned": "left",
            "width": 50,
            resizable: false,
            filter: false,
            sortable: false,
            minWidth: 50,
            maxWidth: 50,
            lockPosition: "left",
        }]
        cfsValue = a.concat(cfsValue)

        const pageData2: any = reactive({
            showAdd: false,
            dataList: [],
            page: 1,
            size: 10,
            total: 0,
            time: [],
            circulatCard: '',
            verifyShrinkRegistCode: '',
            clothCode: '',
            brandName: '',
            customName: ''
        })

        const importHandler = () => {
            pageData2.dataList = []
            pageData2.time = []
            pageData2.circulatCard = ''
            pageData2.verifyShrinkRegistCode = ''
            pageData2.clothCode = ''
            pageData2.brandName = ''
            pageData2.customName = ''
            pageData2.showAdd = true
        }

        const CsChangePage = (val: any) => {
            pageData2.page = val
        }

        const CsChangeSize = (val: any) => {
            pageData2.size = val
        }

        const SshuiSelect = () => {
            post({
                url: '/pdm/VerifyShrinkRegist/getPage',
                data: {
                    "page": pageData2.page,
                    "size": pageData2.size,
                    "beginDate": pageData2.time[0] ? pageData2.time[0] : '',
                    "endDate": pageData2.time[1] ? pageData2.time[1] : '',
                    "circulatCard": pageData2.circulatCard,
                    "verifyShrinkRegistCode": pageData2.verifyShrinkRegistCode,
                    "clothCode": pageData2.clothCode,
                    "brandName": pageData2.brandName,
                    "customName": pageData2.customName,
                    auditState: 1
                },
            }).then(({ code, data, message }) => {
                if (code == 200) {
                    pageData2.dataList = data.list
                    pageData2.total = data.total
                } else {
                    Message.error(message)
                }
            })
        }
        const SsAddSopit = () => {
            if (gridOption.value.getSelectedRows().length == 1) {
                for (let item in gridOption.value.getSelectedRows()[0]) {
                    dataForm[item] = gridOption.value.getSelectedRows()[0][item]
                }
                dataForm['planCode'] = gridOption.value.getSelectedRows()[0]['contractNo']
                dataForm['burstStrength'] = gridOption.value.getSelectedRows()[0]['dilapidationStrength']
                dataForm['abscissHangDry'] = gridOption.value.getSelectedRows()[0]['shrinkageHangDryTransverse']
                dataForm['straightHangDry'] = gridOption.value.getSelectedRows()[0]['shrinkageHangDryStraight']
                dataForm['abscissThrowDry'] = gridOption.value.getSelectedRows()[0]['shrinkageThrowDryTransverse']
                dataForm['straightThrowDry'] = gridOption.value.getSelectedRows()[0]['shrinkageThrowDryStraight']
                dataForm['abscissFlatDry'] = gridOption.value.getSelectedRows()[0]['shrinkageFlatDryTransverse']
                dataForm['straightFlatDry'] = gridOption.value.getSelectedRows()[0]['shrinkageFlatDryStraight']
                pageData2.showAdd = false
            } else {
                Message.error('请选择单条')
            }
        }

        // watch(()=>dataForm.verifyStandard,()=>{
        //     post({
        //         url:'pdm/VerifyManage/getCustomVerifyProject',
        //         data:{
        //             customName:dataForm.customName,
        //             verifyStandard:dataForm.verifyStandard,
        //         }
        //     }).then((res:any)=>{
        //         dataForm.verifyManageDetail = res.data
        //     })
        // })

        return {
            SsAddSopit,
            SshuiSelect,
            CsChangeSize,
            CsChangePage,
            cfsValue,
            gridOption,
            gridReady,
            defaultColDef,
            localeTextData,
            pageData2,
            dels,
            huiche,
            addHandler,
            selectHandler,
            exportHandler,
            auditHandler,
            dyBoufeiHandler,
            searchData,
            pageData,
            importHandler,
            saveHandler,
            dataForm,
            createResultColumns,
            handleChange,
            closePop,
            pushMessHandler,
            auditState,
            changHandler,
            selectChange,
            searchHandler,
            options,
            loading,
            formRef,
            secondChangeHandler,
            rangePicckerChange,
            changHeadShow,
            headerShow,
            scrollbar,
            rowKey,
            selectedRowKeys,
            table,
            hasAudit,
            cascaderChangePushDepart,
            cascaderChangeDepart,
            casObPushDepart,
            casObDepart,
            iconText,
            tableRowClassName,
            addForm,
            toHasRowDataEdit,
            printDataClick,
            changeCircul,
            circulRef,
            changCode,
            toHasRowDataPrint,
            selectChangeVerify
        };
    },
    components: { PhyLabelPrint, PageTabelLayout, PhyManageUnApproved,  }
}
</script>

<style scoped>
.arco-drawer-header .arco-drawer-title {
    width: 100% !important;
}

.aInput,
.mInput {
    width: 270px;
    background: #fff !important;
    border: 1px solid #c9cdd3 !important;
}
:deep(.arco-picker input){
    padding-left: 0 !important;
}
:deep(.arco-picker){
    padding-left: 0 !important;
}
:deep(.arco-picker-separator){
    padding: 0 !important;
}

</style>